﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SudokuWPF.UserControls
{
    /// <summary>
    /// SudokuBoard.xaml 的交互逻辑
    /// </summary>
    public partial class SudokuBoard : UserControl
    {
        public SudokuBoard()
        {
            InitializeComponent();
            this.IsEnabled = false;
            GameBoard = new Board(9);
        }

        public Board GameBoard
        {
            get
            {
                return MainList.DataContext as Board;
            }
            set
            {
                MainList.DataContext = value;
            }
        }

        protected override Size ArrangeOverride(Size arrangeBounds)
        {
            Size sz = new Size(Math.Min(arrangeBounds.Width, arrangeBounds.Height), Math.Min(arrangeBounds.Width, arrangeBounds.Height));
            return base.ArrangeOverride(sz);
        }
    }
}
